<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>教务系统</title>
    <link rel="stylesheet" href="/css/common.css">
    <link rel="stylesheet" href="/css/punishment.css">
    <script src="/js/jquery-1.9.1.min.js"></script>
</head>
<body>
<div class="container flgure">
    <div class="content">
        <div class="header clearfix">
            <div class="bottom fr">
                <a href="javascript:;"  class="l">编辑</a>
                <a href="javascript:;" class="r">保存</a>
            </div>
        </div>
        <div class="main">
            <!--基础信息-->
            <div class="BasicInformation">
                <div class="title">
                    基础信息
                </div>
            </div>
       <form id="form1">
            <div class="content clearfix">
                <div class="left fl">
                    <div>
                        <label for="">姓名：</label>
                        <input id="username" type="text" name="username" value="${aaa.username!}" class="oInp" disabled>
                    </div>
                    <div>
                        <label for="">职务：</label>
                        <input  id="job" type="text" name="job" value="${ccc.job!}" class="oInp" disabled>
                    </div>
                    <div>
                        <label for="">联系电话：</label>
                        <input  id="phone" type="text" name="phone" value="${aaa.phone!}" class="oInp" disabled>
                    </div>
                    <div>
                        <label for="">微信：</label>
                        <input  id="wx" type="text" name="wx" value="${aaa.wx!}" class="oInp" disabled>
                    </div>
                    <div>
                        <label for="">性别：</label>
                        <input  id="sex" type="text" name="sex" value="${aaa.sex!}" class="oInp" disabled>
                    </div>


                    <div>
                        <label for="">生日：</label>

                       <#if aaa.birthday?exists>
                       <input  id="birthday" type="date" name="birthday" value="${aaa.birthday?string("yyyy-MM-dd")}" class="oInp" disabled>

                       <#else>
                       <input  id="birthday" type="date" name="birthday" class="oInp" disabled>
                       </#if>

                    </div>
                    <div>
                        <label for="">地址：</label>
                        <input  id="address" type="text" name="address" value="${aaa.address!}" class="oInp" disabled>
                    </div>
                    <div>
                        <label for="">QQ：</label>
                        <input  id="qq" type="text" name="qq" value="${aaa.qq!}" class="oInp" disabled>
                    </div>

                </div>
                <div class="reason fl">
                    <p>个人简介：
                    <p>
                    <div>
                        <textarea id="intro"  name = "intro"  class="oInp" disabled>${ccc.intro!}</textarea>
                    </div>
                </div>
            </div>
       </form>
        </div>
    </div>
</div>

<script>
   // $('select').attr('value','0');
    $('.l').click(function () {
        $('.oInp').removeAttr('disabled');
    });

    $('.r').click(function () {
        $.ajax({
            //几个参数需要注意一下
            type: "POST",//方法类型
            dataType: "json",//预期服务器返回的数据类型
            url: "/admin/teacher/update" ,//url
            data: $('#form1').serialize(),
            success: function (result) {
                //     console.log(result);//打印服务端返回的数据(调试用)
                if (result.code == 200) {
                    alert("提交成功");
                }
                ;
            },
           error : function() {
                 alert("异常！");
        }
        });


        $('.oInp').attr('disabled','disabled');

    });

</script>

</body>
</html>
